<?php
include '../../public/index.php';
$data = json_decode(file_get_contents('php://input'), true);
if(empty($data["id"])||empty($data["type"])||empty($data["app_name"])||empty($data["grade"])||empty($data["count"])||empty($data["edition"])||empty($data["update_time"])||empty($data["info"])){die(json_encode(array("code" => 1, "message" => "json格式错误")));return;}
$query = mysqli_query($connect,"update app_info set type='{$data["type"]}',app_name='{$data["app_name"]}',grade='{$data["grade"]}',count='{$data["count"]}',edition='{$data["edition"]}',update_time='{$data["update_time"]}',info='{$data["info"]}' where id=".$data["id"].";");
if(!$query){mysqli_close($connect);die(json_encode(array("code" => 500, "message" => "修改数据失败")));}
mysqli_close($connect); 
die(json_encode(array("code" => 0,"message"=>"修改数据成功")));